package com.zsyh.jiujiu.adepter;

import android.content.Context;
import android.view.View;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import android.widget.TextView;

import com.zsyh.jiujiu.R;
import com.zsyh.jiujiu.bean.ClassOneBean;

import java.util.List;

/**
 * @ProjectName: livvehelp
 * @Package: com.zsyh.lsb.ui
 * @ClassName:
 * @Description: java类作用描述
 * @Author: zsyh
 * @CreateDate: 2020/9/7 11:59
 * @UpdateUser: liangwanbo
 * @UpdateDate: 2020/9/7 11:59
 * @UpdateRemark: 更新说明
 * @Version: 1.0
 */
public class ClassOneAdepter extends CommonAdapter<ClassOneBean.DataBean> {

    private Context mContext;
    private int select=0;
    private List<Integer> list;


    public void setSelects(int select){
        this.select=select;
        notifyDataSetChanged();

    }


    public ClassOneAdepter(Context context, int layoutId, List<ClassOneBean.DataBean> datas,List<Integer> list) {
        super(context, R.layout.item_yiji, datas);
        mContext=context;
        this.list=list;
    }

    @Override
    public void convert(ViewHolder holder, ClassOneBean.DataBean dataBean, int position) {
        holder.setText(R.id.name, dataBean.getClassName());
        if (list.get(position)==1) {
            ((TextView) holder.getView(R.id.name)).setTextColor(mContext.getResources().getColor(R.color.color_3));
            ((RelativeLayout) holder.getView(R.id.rebgs)).setBackgroundColor(mContext.getResources().getColor(R.color.white));
            ((ImageView) holder.getView(R.id.biao)).setVisibility(View.VISIBLE);
        } else {
            ((TextView) holder.getView(R.id.name)).setTextColor(mContext.getResources().getColor(R.color.color_9));
            ((RelativeLayout) holder.getView(R.id.rebgs)).setBackgroundColor(mContext.getResources().getColor(R.color.noxuan));
            ((ImageView) holder.getView(R.id.biao)).setVisibility(View.GONE);
        }
    }

}
